package com.kern.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * Created by caoshi at 20:19 2021-08-27
 */
public class MyFilter implements Filter {


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("MyFilter.init");
    }

    @Override
    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("before do Filter");
        filterChain.doFilter(req, resp);
        System.out.println("After do filter");
    }

    @Override
    public void destroy() {
        System.out.println("MyFilter.destroy");
    }
}
